home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / pc / media / dirs / BackUp / PrescribedBurn.dir / 00010_Script_Ending < prev    next >
Text File  |  2002-10-15  |  2KB  |  67 lines

  1. --ENDING--
  2. --Attach this behavior to a sprite to make it flash and play a sound when a movie or sound channel is empty.
  3.  
  4. property SpNum, Flashing, PlaySound, SndChannel, MovieCheck, Quename, QueSprite, guard, soundguard, Toggle
  5.  
  6. on new me
  7.   SpNum = me.spritenum
  8.   guard = 0
  9.   soundguard = 0
  10.   Toggle = 0
  11. end
  12.  
  13. on getPropertyDescriptionList me
  14.   set pList = [\
  15.   #Flashing : [#comment: "What member would you like to use as the hot state (FilmLoop)?", #format:#filmloop, #default: ""],\
  16.   #PlaySound: [#comment: "Which sound would you like to play?", #format:#sound, #default: ""],\
  17.   #SndChannel : [#comment: "Wait for sound channel to empty before begining?", #format:#string, #range: ["No", "Channel 1", "Channel 2", "All Channels"], #default: 0],\
  18.   #Moviecheck : [#comment: "Wait for a movie to finish before beginning? ", #format:#boolean, #default: 0],\
  19.   #QueName : [#comment: "If checked, what is the movie's member name? " & RETURN & "---Don't forget to attach the Ending2 behavior to the movie--", #format:#quicktimemedia, #default: ""]\
  20.   ]
  21.   return plist
  22. end
  23.  
  24. --Makes the sprite flash and the sound play.
  25. on Ending me
  26.   if guard = 0 then
  27.     QueSprite = sendallsprites (#IdCall)
  28.     guard = 1
  29.   end if
  30.   if (Moviecheck = 1) then
  31.     if (member(QueName).duration = sprite(QueSprite).movietime) then --If movie is over.
  32.       sprite(SpNum).membernum = member(Flashing).number
  33.       if soundguard = 0 then
  34.         sound(1).play(member(Playsound))
  35.         soundguard = 1
  36.       end if
  37.     end if
  38.   else if SndChannel <> "No" then --If the sound channel is empty.
  39.     if ((SndChannel = "Channel 1") and (soundbusy(1) = 0)) or ((SndChannel = "Channel 2") and (soundbusy(2) = 0)) or (((SndChannel = "All Channels") and (soundbusy(1) = 0)) and ((SndChannel = "All Channels") and (soundbusy(2) = 0))) then
  40.       sprite(SpNum).membernum = member(Flashing).number
  41.       if soundguard = 0 then
  42.         sound(1).play(member(Playsound))
  43.         soundguard = 1
  44.       end if
  45.     end if
  46.   else if toggle = 1 then
  47.     sprite(SpNum).membernum = member(Flashing).number
  48.     if soundguard = 0 then
  49.       sound(1).play(member(Playsound))
  50.       soundguard = 1
  51.     end if
  52.   end if
  53. end
  54.  
  55. on changetoggle me
  56.   if toggle = 0 then
  57.     toggle = 1
  58.   end if
  59. end
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.